package com.outstanding.junit.enums;

import com.outstanding.framework.core.BaseEnum;

public enum IsDelete implements BaseEnum<IsDelete,Integer> {

	DELETE(0,"删除"), 
	NORMAL(1,"正常");
	
	private Integer code;
	
	private String name;
	
	private IsDelete(Integer code, String name){
        this.code = code;
        this.name = name;
    }
	
	/**
	 * 根据code获取对应枚举
	 * @param code
	 * @return
	 */
	public static IsDelete getByCode(Integer code) {
		IsDelete[] array = IsDelete.values();
		for (IsDelete bd : array) {
			if (bd.getCode()==code) {
				return bd;
			}
		}
		return null;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
